// Widget configuration.

form.dashboard-widget-svggraph {
	max-width: 1330px;
	min-width: 1120px;
	width: #{"min(100vw - 42px, calc(var(--modal-max-width) - 22px))"};

	.graph-widget-config-tabs {
		grid-column: 1 / -1;
	}

	.graph-widget-config-tabs {
		> .tabs-nav {
			border-top: 1px solid $ui-border-color;
		}

		.ui-tabs-nav {
			position: sticky;
			top: 0;
			background: $header-bg-color;
			z-index: 3;
		}
	}

	.table-forms-container {
		border: 1px solid $ui-border-color;
		border-top: none;
	}

	.table-forms-separator {
		padding: 0;
	}

	.dataset-head,
	.dataset-body.list-accordion-item-body {
		display: contents;
	}

	.dataset-head {
		.multiselect-control {
			overflow: hidden;
			margin: -2px;
			padding: 2px;

			.multiselect {
				overflow: hidden;
				flex-grow: 1;
			}
		}
	}

	.dataset-body {
		.form-grid {
			grid-template-columns: auto 1fr;
			grid-auto-rows: auto;
			padding-top: 0;

			> label {
				display: inline-block;
				text-align: right;
				min-width: 80px;
				max-width: 120px;

				@extend %overflow-ellipsis;
			}

			&:first-child {
				grid-column-start: 5;
			}

			.table-tags {
				max-width: 453px;

				.table-tags-input {
					min-width: 100px;
					max-width: 130px;
					width: 100%;
				}

				z-select {
					min-width: 120px;
				}
			}
		}
	}

	.list-item-actions {
		grid-column: span 1 / -1;
		text-align: right;

		.btn-icon {
			@extend %button-size-medium;
		}
	}

	.items-list {
		grid-column: 4 / span 3;
	}

	.list-vertical-accordion {
		position: relative;
		overflow: visible;
		margin-top: -5px;
		margin-bottom: 5px;

		.sortable:not(.sortable-disabled) {
			.list-accordion-item {
				> .drag-icon + label {
					cursor: grab;
				}
			}
		}
	}

	.list-accordion-item {
		position: relative;
		display: grid;
		grid-template-columns: 5px 100px 24px 24px 1fr 1fr 24px;
		grid-gap: 10px;
		align-items: start;
		padding: 5px 0;

		> .drag-icon {
			height: 24px;
			margin-left: -2px;
		}

		> label {
			pointer-events: initial;
			overflow: hidden;
			line-height: 24px;
			text-align: left;
			text-overflow: ellipsis;
		}

		&.list-accordion-item-opened {
			&::before {
				content: ' ';
				position: absolute;
				top: 24px;
				bottom: 0;
				left: 136px;
				width: 2px;
				background: $ui-border-color;
			}
		}

		&.list-accordion-item-closed {
			.multiselect {
				height: 24px;
				overflow: hidden;
			}

			.dataset-head {
				.table-forms-separator {
					border: none;
				}

				.single-item-table {
					thead,
					tfoot,
					.table-col-handle,
					.table-col-action {
						display: none;
					}
				}
			}

			.dataset-body {
				display: none;
			}

			.items-list {
				padding-left: 0;
			}
		}
	}

	.single-item-table {
		.table-col-handle { width: 12px; }
		.table-col-no { width: 20px; }
		.table-col-color { width: 24px; }
		.table-col-action { width: 55px; }

		th {
			padding: 5px 5px 5px 0;
		}

		.single-item-table-row td {
			padding: 0 5px 5px 0;
		}

		th,
		td {
			&:first-child {
				padding-left: 5px;
			}
		}

		tfoot td {
			padding: 5px 5px 5px 10px;
		}

		tbody:not(:empty) + tfoot td {
			padding-top: 0;
		}

		.reference-hint {
			margin-right: 4px;

			&::before {
				font-size: $icon-medium-size;
				color: $link-color;
			}
		}

		.unavailable-widget {
			.reference-hint {
				&::before {
					color: $form-disabled-font-color;
				}
			}

			a {
				color: $form-disabled-font-color;
			}
		}
	}

	.override-host-field-view {
		overflow: hidden;
		margin: -2px;
		padding: 2px;

		.multiselect {
			overflow: hidden;
			flex-grow: 1;
		}
	}

	.overrides-list {
		position: relative;
		margin: -5px 0 -5px 15px;
	}

	.overrides-list-item {
		position: relative;
		display: grid;
		grid-template-columns: 1fr 1fr 24px;
		grid-gap: 5px 10px;
		align-items: start;
		padding: 5px 0;
		overflow: visible;
		margin-top: -5px;
		margin-bottom: -5px;

		.drag-icon {
			position: absolute;
			top: 5px;
			left: -17px;
			height: 24px;
		}

		.multiselect-control {
			overflow: hidden;
			margin: -2px;
			padding: 2px;

			.multiselect {
				overflow: hidden;
				flex-grow: 1;
			}
		}
	}

	.overrides-foot {
		padding: 5px 0;
	}

	.overrides-options-list {
		grid-column: 1 / -1;
		padding: 0 24px 8px 0;
		border-bottom: 1px solid $table-border-color;
		white-space: normal;

		li {
			display: inline-block;
			margin-bottom: 2px;
			vertical-align: middle;
			white-space: nowrap;

			> div {
				padding: 1px 0 1px 1px;
				background-color: $ui-bg-selected-color;
				border-radius: 2px;
				line-height: 22px;

				span {
					padding-left: 8px;
					color: $ui-selected-color;
				}

				input[type=text] {
					width: 85px;
					min-height: 22px;
					border-style: none;
				}
			}

			.color-picker {
				line-height: 22px;
			}

			&:not(:last-child) {
				margin-right: 5px;
			}
		}

		.btn-icon {
			min-width: 18px;
			margin: -1px 0;
			color: $ui-selected-color;

			&:hover,
			&:focus {
				color: $ui-selected-hover-color;
			}
		}

		.color-picker {
			.color-picker-preview {
				width: 20px;
				min-width: 20px;
				height: 20px;
				margin: 1px 0 1px 1px;
			}
		}
	}

	.no-items-message {
		display: none;
		line-height: 24px;
		color: $font-alt-color;
	}
}

// Widget view.

div.dashboard-widget-svggraph {
	overflow-x: hidden;
}
